package com.ymatou.iapi.csim.testcase;

import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.csim.parameter.GetAllQuestionGuideBean;
import com.ymatou.iapi.csim.parameter.GetAllQuestionGuideResp.questionguide;
import com.ymatou.iapi.csim.parameter.GetHistorySessionListResp.cssession;
import com.ymatou.iapi.csim.service.GetAllQuestionGuideCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.database.model.ymt_questionguide;
import com.ymttest.database.sqlwapper.CSIM.ymt_questionguideWapper;
/**
*获取所有的问题向导
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetAllQuestionGuide{
	private static GetAllQuestionGuideBean getallquestionguideBean;
	private static GetAllQuestionGuideCall getallquestionguideCall;
	private ymt_questionguideWapper questionguideWapper=new ymt_questionguideWapper();
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取所有的问题向导");
	}

	@Before
	public void caseUp() {
		getallquestionguideBean=new GetAllQuestionGuideBean();
		getallquestionguideCall=new GetAllQuestionGuideCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getallquestionguideCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetAllQuestionGuide_001() {
		Logger.start(true,"获取所有的问题向导");
		try {
		
			getallquestionguideCall.setData(getallquestionguideBean);
			getallquestionguideCall.callService();	
			List<questionguide> questionCall= getallquestionguideCall.GetAllQuestionGuide().getResult();
			List<ymt_questionguide> questionList=questionguideWapper.selectby(null);
			for(int i=0;i<questionList.size();i++)
			{
				Logger.verifyEquals(questionCall.get(i).getId(), questionList.get(i).getId(), "验证数据库表ymt_questionguide中第"+(i+1)+"个字段id");
				Logger.verifyEquals(questionCall.get(i).getIconUrl(), questionList.get(i).getIconUrl(), "验证数据库表ymt_questionguide中第"+(i+1)+"个字段IconUrl");
				Logger.verifyEquals(questionCall.get(i).getTitle(), questionList.get(i).getTitle(), "验证数据库表ymt_questionguide中第"+(i+1)+"个字段Title");
				Logger.verifyEquals(questionCall.get(i).getType(), questionList.get(i).getType(), "验证数据库表ymt_questionguide中第"+(i+1)+"个字段Type");
				Logger.verifyEquals(questionCall.get(i).getGuideTips(), questionList.get(i).getGuideTips(), "验证数据库表ymt_questionguide中第"+(i+1)+"个字段GuideTips");
			}
				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}